import Vue from 'vue'
import Router from 'vue-router'
import indexRouter from "./indexChildren.js"

Vue.use(Router)

function routeFN (path, file, name, children=null) {
  return {
    exact: false,
    path,
    name,
    children,
    component: () => import('@/pages/' + file)
  }
}

const router = new Router({
  routes: [
	  routeFN("/","Index","index",indexRouter),
  ]
});
//导航守卫
// router.beforeEach((to, from, next) => {
//   console.log(to)
//   console.log(from)
//   next();
// })
export default router
